import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

interface UserInfo {
    nickname: string
    avator: string
    id: string
    username: string
    password: string
}
export const SetInfo = defineStore('userInfo', () => {
    const avator = ref('')
    const nickname = ref('')
    const username = ref('')
    const password = ref('')

    const id = ref('')

    function SetUserInfo(data: UserInfo) {
         console.log(data.username)
        avator.value = data.avator
        nickname.value = data.nickname
        username.value = data.username
        password.value = data.password
        id.value = data.id
    }
    return { nickname, username, avator, id, password, SetUserInfo }
})